import Vue from 'vue'
import Router from 'vue-router'
import routes from './router'


Vue.use(Router)
const router = new Router({
    mode: 'hash',
    base: process.env.BASE_URL, //需要设置动态根目录
    routes 
})

router.beforeEach((to, from, next) => {
    const title = to.meta ? to.meta.title : null
    if (title)  document.title = title
    next()
})


export default router
